import axios from '~/plugins/axios';
import { basicConfig } from '~/assets/js/config'

import * as types from '../../mutation-types/adv-assets/index';


//获取受众列表
export const getListAudience =  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/audience/listAudience.do',preload||{})
	.catch(function (error) {
		
    });
	
};

//获取主页列表
export const getListPage =  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/audience/listPage.do',preload||{})
		
};

//自定义受众查询
export const getListCustomAudience=  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/adset/audience/listCustomAudience.do',preload||{})	
};

//上传客户文件
export const getUploadUser =  function({ commit, state }, preload)  {
	 return axios.post(basicConfig.baseUrl + '/assets/audience/uploadUser.do',preload||{})
	
		
};

//创建客户文件受众
export const getCreateCustomAudience =  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/audience/createCustomAudience.do',preload||{})
	
};

//创建类似受众
export const getCreateLookAlikeAudience =  function({ commit, state }, preload)  {
  return axios.post(basicConfig.baseUrl + '/assets/audience/createLookAlikeAudience.do',preload || {})
}

//创建主页互动受众
export const getCreatePageAudience=  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/audience/createPageAudience.do',preload||{})
		
};

//删除非已保存受众
export const getDeleteCustomAudience=  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/audience/deleteCustomAudience',preload||{})
		
};

//删除已保存受众
export const getDeleteSavedAudience=  function({ commit, state }, preload)  {//想让请求结果返回成功
	return axios.post(basicConfig.baseUrl + '/assets/audience/deleteSavedAudience',preload||{})
	
};

//更新客户文件受众
export const getUpdateCustomAudience=  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/audience/updateCustomAudience',preload||{})
		
};

//更新类似受众
export const getUpdateLookAlikeAudience=  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/audience/updateLookAlikeAudience',preload||{})
		
};

//更新主页互动受众
export const getUpdatePageAudience=  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/audience/updatePageAudience',preload||{})
		
};


//更新已保存受众
export const getUpdateSavedAudience=  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/audience/updateSavedAudience',preload||{})
		
};

//类似受众地区查询列表
export const getListLookAlikeLocation=  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/audience/listLookAlikeLocation.do',preload||{})
		
};

//保存图片
export const saveAddImgs=  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/img/save.do',preload||{})	
};

//修改图片名称
export const changeImgName=  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/img/updateImg.do',preload||{})
		
};

//删除图片
export const deleteAddImg=  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/img/deleteImg.do',preload||{})
};

//删除图片key
export const deleteAddImgKey=  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/img/deleteByKey.do',preload||{})
};

//查询图片库
export const seachAddImg=  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/img/selectImgs.do',preload||{})
};

//根据key查询图片地址
export const getUrlByKeyImg=  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/img/getUrlByKey.do',preload||{})
};

//查询FB图片库
export const seachfbImgList=  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/img/fbImgList.do',preload||{})
};

//根据key查询视频地址
export const getUrlByKeyVideo=  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/video/getUrlByKey.do',preload||{})
};

//保存视频
export const saveAddVideo=  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/video/save.do',preload||{})
};

//修改视频名称
export const changeVideoName=  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/video/update.do',preload||{})
};

//删除视频
export const deleteAddVideo=  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/video/delete.do',preload||{})
};

//删除视频
export const deleteAddVideoKey=  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/video/deleteByKey.do',preload||{})
};

//查询视频库
export const seachAddVideo=  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/video/select.do',preload||{})
};

//查询FB视频库
export const seachfbVideoList=  function({ commit, state }, preload)  {
	return axios.post(basicConfig.baseUrl + '/assets/video/fbVideoList.do',preload||{})
};

